package com.example.testforbookstore;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.os.Bundle;

import java.util.ArrayList;
import java.util.List;

public class ShoppingCarActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.shopping_car);
        List<Book> testBookList = new ArrayList<>();
        testBookList.add(new Book(1,"hh1这个谁西安市西安市下狠手", "gbg", 20.12, R.drawable.test25, "good"));
        testBookList.add(new Book(2,"hh2", "gbg", 20.12, R.drawable.test26, "good"));
        testBookList.add(new Book(3,"hh3", "gbg", 20.12, R.drawable.test25, "good"));
        testBookList.add(new Book(4,"hh4", "gbg", 20.12, R.drawable.test26, "good"));
        testBookList.add(new Book(5,"hh1这个谁西安市西安市下狠手", "gbg", 20.12, R.drawable.test25, "good"));
        testBookList.add(new Book(6,"hh2", "gbg", 20.12, R.drawable.test26, "good"));
        testBookList.add(new Book(7,"hh3", "gbg", 20.12, R.drawable.test25, "good"));
        testBookList.add(new Book(8,"hh4", "gbg", 20.12, R.drawable.test26, "good"));
        RecyclerView recyclerView  = (RecyclerView) findViewById(R.id.shopping_car_recyclerList);

        recyclerView.setLayoutManager(new LinearLayoutManager(this));
        recyclerView.setAdapter(new MeBooksAdapter(testBookList));
    }
}